﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;

namespace JobServerConsoleHost
{
    public class JobServer
    {
        public void Activate()
        {
            doPollSite(this, null);
            
            Timer timer = new Timer();
            timer.Elapsed += new ElapsedEventHandler(doPollSite);
            timer.Interval = 7200000; ///2 hrs.
            timer.Enabled = true;
        }

        void doPollSite(object sender, ElapsedEventArgs e)
        {
            lock (this)
            {
                new PollServerForNewWebinarsJob().DoAction();
            }
        }
    }
}
